package com.flashflexpro.flexdirector.model{
    import flash.events.EventDispatcher;

    [Bindable]
    [RemoteClass]
    public class NameAndComment extends EventDispatcher{

        public function NameAndComment(){
//            name = "Unamed " + getQualifiedClassName( this ).split( "::" )[ 1 ];
        }

        public function getId():String{
            throw new Error( "Override me !" );
        }

        public var name:String;

        public var comment:String;

        public function copyInto( parent:NameAndComment, newType:Class ):NameAndComment{
            var rt:NameAndComment;
            if( newType == null ){
                rt = new NameAndComment();
            }
            else{
                rt = new newType() as NameAndComment;
            }
            rt.name = name;
            rt.comment = comment;
            return rt;
        }


        public function treeWalk( nodeFunc:Function, self:Object = null, parent:NameAndComment = null ):void{
            nodeFunc.call( self, this, parent );
        }

        public function destroy():void{
            trace( this + ".destroy not implemented yet." )
        }
    }
}